<template>
	<div>
		<el-row>
			<el-col :span="8" v-for="(item, index) in cardConfig" :key="index">
				<el-card class="box-card">
					<div slot="header" class="clearfix">
						<span>{{item.title}}</span>
						<el-button @click="gotoFather" v-if="item.button" style="float: right; padding: 3px 0" type="text">{{item.button}}</el-button>
					</div>
					<div v-for="(itemChild, indexChild) in item.items" :key="indexChild">
						<p v-if="itemChild.default">{{itemChild.text}}: {{itemChild.default}}</p>
						<p v-else >{{itemChild.text}}: {{cardData[item.field][itemChild.field]}}</p>
					</div>
				</el-card>
			</el-col>
		</el-row>
	</div>
</template>

<script>
	import http from 'assets/js/http'
	export default {
		props: ['cardData', 'cardConfig'],
		data() {
			return {
			}
		},
		created() {
			
		},
		methods: {
			gotoFather() {
				this.$emit('ondefaultAccount')
			}
		},
		mixins: [http]
	}
</script>

<style scoped>

</style>